package com.shadow.mall.tms.controller;

import com.shadow.mall.common.core.JsonResult;
import com.shadow.mall.tms.api.TmsApi;
import com.shadow.mall.tms.domain.SendOutDTO;
import com.shadow.mall.tms.domain.SendOutRequest;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/tms")
@Slf4j
public class TmsController {

    @Autowired
    TmsApi tmsApi;

    @RequestMapping("/sendOut")
    JsonResult<SendOutDTO> sendOut(@RequestBody SendOutRequest request){
        log.info("发货  sendOut");
        return tmsApi.sendOut(request);
    }


    @RequestMapping("/cancelSendOut")
    JsonResult<Boolean> cancelSendOut(@RequestBody String orderId){
        log.info("取消  sendOut");
        return tmsApi.cancelSendOut(orderId);
    }
}
